<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../jquery.js"></script>
    <script src="https://cdn.staticfile.org/axios/0.18.0/axios.min.js"></script>
    <script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
    <script src="https://cdn.staticfile.org/vue-resource/1.5.1/vue-resource.min.js"></script>
</head>
<body>
<div id="#div1">
    <button @click="sendJsonp">发送Jsonp</button>
</div>
</body>
<!--<script>-->
<!--    var jsonp1=function (data) {-->
<!--        console.log("=============")-->
<!--        alert("name:"+data.name+"age:"+data.age)-->
<!--    }-->
<!--</script>-->

<script>
       // //动态创建标签元素
       // let objscript= $ ('<script><\/script>');
       // var url="http://localhost:2020/aa?callback=handleJsonp"
       // objscript.attr("src",url);
       // $("body").append(objscript);
       //
       // function handleJsonp(data) {
       //    $("body").attr(data)
       // }
   //直接
// https://sug.so.360.cn/suggest?callback=suggest_so&encodein=utf-8&encodeout=utf-8&format=json&src=so_home&fields=word&word=h&llbq=A5%2CB5%2CC5%2CD5
//     $.ajax({
//         url:"https://sug.so.360.cn/suggest?h",
//         async:false,
//         type:"get",
//         dataType:"jsonp",
//         jsonp:"callback",
//
//         success:function (data) {
//             console.log(data)
//                alert(data)
//         }
//
//     })

    new Vue({
        el:"#div1",
        methods:{
            sendJsonp:function () {
              this.$http.jsonp("https://sug.so.360.cn/suggest",{param:{
                   word:"h"
                  }}).then(response=>{
                      console.log(response.body.result)
              })
            }
        }
    })
</script>

<!--<script src="http://localhost:2020/jsonp1.js"></script>-->
</html>